final static String OnlyLocalFilesError = jEdit.getProperty("macro.rs.ToggleReadOnly.OnlyLocalFiles.error", "This macro only works on local files.");
final static String OnlyWindowsUnixMacosError = jEdit.getProperty("macro.rs.ToggleReadOnly.OnlyWindowsUnixMacos.error", "This macro only works on Windows, Unix, & MacOS X.");
//Process
CmdThread(cmd, view)
{
run()
{
process = Runtime.getRuntime().exec(cmd);
process.waitFor();
view.getBuffer().checkFileStatus(view);
}
return this;
}
void ToggleReadOnly(view)
{
buffer = view.getBuffer();
// must be using file vfs
if(!buffer.getVFS().getName().equals("file"))
{
Macros.error(view, OnlyLocalFilesError);
return;
}
// is read-only be turned on or off
readonly = buffer.isReadOnly();
if (OperatingSystem.isUnix() || OperatingSystem.isMacOS())